package com.iyundao.io.mapper;

import com.iyundao.io.model.ActivityCategory;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface ActivityCategoryMapper {
    @Insert({
        "insert into activitycategory (id, categoryname, ",
        "categoryintegral)",
        "values (#{id,jdbcType=INTEGER}, #{categoryname,jdbcType=VARCHAR}, ",
        "#{categoryintegral,jdbcType=INTEGER})"
    })
    int insert(ActivityCategory record);

    @InsertProvider(type= ActivityCategorySqlProvider.class, method="insertSelective")
    int insertSelective(ActivityCategory record);

    @Select("select id,categoryname,categoryintegral from activitycategory where id=#{id,jdbcType=INTEGER}")
    ActivityCategory selectById(Integer id);

    @Select("select * from activitycategory")
    List<ActivityCategory> findAll();
}